﻿//-----------------------------------------------------------------------
// <copyright file="CharacterTest.cs" company="FastNET Services">
//     Copyright (c) 2008-2009. All Rights Reserved.
// </copyright>
// <license>
//     GPLv2
// </license>
// <warranty>
//     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
//     BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
//     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
//     DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//     OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// </warranty>
//-----------------------------------------------------------------------
#region Usings

using System;
using System.Collections.Generic;
using GateShift.Common.Repository;
using GateShift.Common.Repository.Interfaces.DataInterfaces;
using GateShift.Common.Repository.Interfaces.Repositories;
using GateShift.Services.GameFramework.GameObjects;
using GateShift.Testing.Mockup.DataLayer;
using Microsoft.VisualStudio.TestTools.UnitTesting;

#endregion

namespace GateShift.Testing.Services.GameFramework.GameObjects
{
    /// <summary>
    /// Summary description for CharacterTest
    /// </summary>
    [TestClass]
    public class CharacterTest
    {
        #region Test Variables
        private Character _character;
        private ICharacterData _data;
        private MockRepositoryFactory _factory;
        #endregion

        #region Test Properties
        /// <summary>
        /// Gets or sets the test context which provides
        /// information about and functionality for the current test run.
        /// </summary>
        public TestContext TestContext { get; set; }
        #endregion

        #region Test Initialization/Cleanup

        [TestInitialize]
        public void TestInitialize()
        {
            _factory = new MockRepositoryFactory();
            _data = new MockCharacter();

            MockRepositoryFactory.TestInitialize();

            // Set up basic load mocks
            MockRepositoryFactory.GetMock<ICharacterRepository>().Expect(item => item.Create()).Returns(_data);

            _character = new Character(_factory);
        }

        [TestCleanup]
        public void TestCleanup()
        {
            MockRepositoryFactory.TestCleanup();
            _character = null;
        }

        #endregion

        #region CharacterName

        [TestMethod]
        [ExpectedException(typeof(ArgumentNullException))]
        public void CharacterName_Null()
        {
            _character.CharacterName = null;
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentNullException))]
        public void CharacterName_Empty()
        {
            _character.CharacterName = string.Empty;
        }

        [TestMethod]
        [ExpectedException(typeof(FormatException))]
        public void CharacterName_FirstPositionNumber()
        {
            _character.CharacterName = "1Name";
        }

        [TestMethod]
        [ExpectedException(typeof(IndexOutOfRangeException))]
        public void CharacterName_TooLong()
        {
            _character.CharacterName = string.Empty.PadRight(21, 'A');
        }

        [TestMethod]
        [ExpectedException(typeof(FormatException))]
        public void CharacterName_InvalidCharacters()
        {
            _character.CharacterName = "!";
        }

        [TestMethod]
        [ExpectedException(typeof(FormatException))]
        public void CharacterName_Spaces()
        {
            _character.CharacterName = "A Spaced Name";
        }

        [TestMethod]
        public void CharacterName_Success()
        {
            const string TestData = "A123Thisisa123longna";
            _character.CharacterName = TestData;

            Assert.AreEqual(TestData, _data.CharacterName);
        }

        #endregion

        #region Money

        [TestMethod]
        public void Money_Success()
        {
            _character.Money = 123;
            Assert.AreEqual(123, _data.Money);
        }

        #endregion

        #region BaseAccuracy

        [TestMethod]
        public void BaseAccuracy_Success()
        {
            _character.BaseAccuracy = 123;
            Assert.AreEqual(123, _data.BaseAccuracy);
        }

        #endregion

        #region BaseAccuracy

        [TestMethod]
        public void BaseAgility_Success()
        {
            _character.BaseAgility = 123;
            Assert.AreEqual(123, _data.BaseAgility);
        }

        #endregion

        #region BaseEndurance

        [TestMethod]
        public void BaseEndurance_Success()
        {
            _character.BaseEndurance = 123;
            Assert.AreEqual(123, _data.BaseEndurance);
        }

        #endregion

        #region BaseEnergy

        [TestMethod]
        public void BaseEnergy_Success()
        {
            _character.BaseEnergy = 123;
            Assert.AreEqual(123, _data.BaseEnergy);
        }

        #endregion

        #region BaseForce

        [TestMethod]
        public void BaseForce_Success()
        {
            _character.BaseForce = 123;
            Assert.AreEqual(123, _data.BaseForce);
        }

        #endregion

        #region BaseInsight

        [TestMethod]
        public void BaseInsight_Success()
        {
            _character.BaseInsight = 123;
            Assert.AreEqual(123, _data.BaseInsight);
        }

        #endregion

        #region BaseIntellect

        [TestMethod]
        public void BaseIntellect_Success()
        {
            _character.BaseIntellect = 123;
            Assert.AreEqual(123, _data.BaseIntellect);
        }

        #endregion

        #region BaseStrength

        [TestMethod]
        public void BaseStrength_Success()
        {
            _character.BaseStrength = 123;
            Assert.AreEqual(123, _data.BaseStrength);
        }

        #endregion

        #region BaseWill

        [TestMethod]
        public void BaseWill_Success()
        {
            _character.BaseWill = 123;
            Assert.AreEqual(123, _data.BaseWill);
        }

        #endregion

        #region TotalAccuracy

        [TestMethod]
        public void TotalAccuracy_Success_NoClassesOrRace()
        {
            _data.BaseAccuracy = 123;
            Assert.AreEqual(123, _character.TotalAccuracy);
        }

        [TestMethod]
        public void TotalAccuracy_Success_NoClasses1Race()
        {
            IRaceData race = new MockRace();
            MockRepositoryFactory.GetMock<IRaceRepository>().Expect(item => item.Retrieve(new Identity(123))).Returns(race);
            race.ModifierAccuracy = 100;
            _data.RaceID = new Identity(123);

            _data.BaseAccuracy = 123;
            Assert.AreEqual(223, _character.TotalAccuracy);
        }

        [TestMethod]
        public void TotalAccuracy_Success_1ClassNoRace()
        {
            IClassData classData = new MockClass();
            ICharacterClassData characterClassData = new MockCharacterClass();
            MockRepositoryFactory.GetMock<IClassRepository>().Expect(item => item.Retrieve(classData.ID)).Returns(classData);
            MockRepositoryFactory.GetMock<ICharacterClassRepository>().Expect(item => item.Retrieve(_data.ID)).Returns(new List<ICharacterClassData> { characterClassData });
            classData.ModifierAccuracy = 100;
            characterClassData.Ranks = 1;
            characterClassData.ClassID = classData.ID;
            characterClassData.CharacterID = _character.ID;

            _data.BaseAccuracy = 123;
            Assert.AreEqual(223, _character.TotalAccuracy);
        }

        [TestMethod]
        public void TotalAccuracy_Success_2ClassNoRace()
        {
            IClassData classData = new MockClass();
            ICharacterClassData characterClassData = new MockCharacterClass();
            MockRepositoryFactory.GetMock<IClassRepository>().Expect(item => item.Retrieve(classData.ID)).Returns(classData);
            MockRepositoryFactory.GetMock<ICharacterClassRepository>().Expect(item => item.Retrieve(_data.ID)).Returns(new List<ICharacterClassData> { characterClassData, characterClassData });
            classData.ModifierAccuracy = 100;
            characterClassData.Ranks = 1;
            characterClassData.ClassID = classData.ID;
            characterClassData.CharacterID = _character.ID;

            _data.BaseAccuracy = 123;
            Assert.AreEqual(323, _character.TotalAccuracy);
        }

        #endregion

        #region TotalAccuracy

        [TestMethod]
        public void TotalAgility_Success_NoClassesOrRace()
        {
            _data.BaseAgility = 123;
            Assert.AreEqual(123, _character.TotalAgility);
        }

        [TestMethod]
        public void TotalAgility_Success_NoClasses()
        {
            IRaceData race = new MockRace();
            MockRepositoryFactory.GetMock<IRaceRepository>().Expect(item => item.Retrieve(new Identity(123))).Returns(race);
            race.ModifierAgility = 100;
            _data.RaceID = new Identity(123);

            _data.BaseAgility = 123;
            Assert.AreEqual(223, _character.TotalAgility);
        }

        [TestMethod]
        public void TotalAgility_Success_1ClassNoRace()
        {
            IClassData classData = new MockClass();
            ICharacterClassData characterClassData = new MockCharacterClass();
            MockRepositoryFactory.GetMock<IClassRepository>().Expect(item => item.Retrieve(classData.ID)).Returns(classData);
            MockRepositoryFactory.GetMock<ICharacterClassRepository>().Expect(item => item.Retrieve(_data.ID)).Returns(new List<ICharacterClassData> { characterClassData });
            classData.ModifierAgility = 100;
            characterClassData.Ranks = 1;
            characterClassData.ClassID = classData.ID;
            characterClassData.CharacterID = _character.ID;

            _data.BaseAgility = 123;
            Assert.AreEqual(223, _character.TotalAgility);
        }

        [TestMethod]
        public void TotalAgility_Success_2ClassNoRace()
        {
            IClassData classData = new MockClass();
            ICharacterClassData characterClassData = new MockCharacterClass();
            MockRepositoryFactory.GetMock<IClassRepository>().Expect(item => item.Retrieve(classData.ID)).Returns(classData);
            MockRepositoryFactory.GetMock<ICharacterClassRepository>().Expect(item => item.Retrieve(_data.ID)).Returns(new List<ICharacterClassData> { characterClassData, characterClassData });
            classData.ModifierAgility = 100;
            characterClassData.Ranks = 1;
            characterClassData.ClassID = classData.ID;
            characterClassData.CharacterID = _character.ID;

            _data.BaseAgility = 123;
            Assert.AreEqual(323, _character.TotalAgility);
        }

        #endregion

        #region TotalEndurance

        [TestMethod]
        public void TotalEndurance_Success_NoClassesOrRace()
        {
            _data.BaseEndurance = 123;
            Assert.AreEqual(123, _character.TotalEndurance);
        }

        [TestMethod]
        public void TotalEndurance_Success_NoClasses()
        {
            IRaceData race = new MockRace();
            MockRepositoryFactory.GetMock<IRaceRepository>().Expect(item => item.Retrieve(new Identity(123))).Returns(race);
            race.ModifierEndurance = 100;
            _data.RaceID = new Identity(123);

            _data.BaseEndurance = 123;
            Assert.AreEqual(223, _character.TotalEndurance);
        }

        [TestMethod]
        public void TotalEndurance_Success_1ClassNoRace()
        {
            IClassData classData = new MockClass();
            ICharacterClassData characterClassData = new MockCharacterClass();
            MockRepositoryFactory.GetMock<IClassRepository>().Expect(item => item.Retrieve(classData.ID)).Returns(classData);
            MockRepositoryFactory.GetMock<ICharacterClassRepository>().Expect(item => item.Retrieve(_data.ID)).Returns(new List<ICharacterClassData> { characterClassData });
            classData.ModifierEndurance = 100;
            characterClassData.Ranks = 1;
            characterClassData.ClassID = classData.ID;
            characterClassData.CharacterID = _character.ID;

            _data.BaseEndurance = 123;
            Assert.AreEqual(223, _character.TotalEndurance);
        }

        [TestMethod]
        public void TotalEndurance_Success_2ClassNoRace()
        {
            IClassData classData = new MockClass();
            ICharacterClassData characterClassData = new MockCharacterClass();
            MockRepositoryFactory.GetMock<IClassRepository>().Expect(item => item.Retrieve(classData.ID)).Returns(classData);
            MockRepositoryFactory.GetMock<ICharacterClassRepository>().Expect(item => item.Retrieve(_data.ID)).Returns(new List<ICharacterClassData> { characterClassData, characterClassData });
            classData.ModifierEndurance = 100;
            characterClassData.Ranks = 1;
            characterClassData.ClassID = classData.ID;
            characterClassData.CharacterID = _character.ID;

            _data.BaseEndurance = 123;
            Assert.AreEqual(323, _character.TotalEndurance);
        }

        #endregion

        #region TotalEnergy

        [TestMethod]
        public void TotalEnergy_Success_NoClassesOrRace()
        {
            _data.BaseEnergy = 123;
            Assert.AreEqual(123, _character.TotalEnergy);
        }

        [TestMethod]
        public void TotalEnergy_Success_NoClasses()
        {
            IRaceData race = new MockRace();
            MockRepositoryFactory.GetMock<IRaceRepository>().Expect(item => item.Retrieve(new Identity(123))).Returns(race);
            race.ModifierEnergy = 100;
            _data.RaceID = new Identity(123);

            _data.BaseEnergy = 123;
            Assert.AreEqual(223, _character.TotalEnergy);
        }

        [TestMethod]
        public void TotalEnergy_Success_1ClassNoRace()
        {
            IClassData classData = new MockClass();
            ICharacterClassData characterClassData = new MockCharacterClass();
            MockRepositoryFactory.GetMock<IClassRepository>().Expect(item => item.Retrieve(classData.ID)).Returns(classData);
            MockRepositoryFactory.GetMock<ICharacterClassRepository>().Expect(item => item.Retrieve(_data.ID)).Returns(new List<ICharacterClassData> { characterClassData });
            classData.ModifierEnergy = 100;
            characterClassData.Ranks = 1;
            characterClassData.ClassID = classData.ID;
            characterClassData.CharacterID = _character.ID;

            _data.BaseEnergy = 123;
            Assert.AreEqual(223, _character.TotalEnergy);
        }

        [TestMethod]
        public void TotalEnergy_Success_2ClassNoRace()
        {
            IClassData classData = new MockClass();
            ICharacterClassData characterClassData = new MockCharacterClass();
            MockRepositoryFactory.GetMock<IClassRepository>().Expect(item => item.Retrieve(classData.ID)).Returns(classData);
            MockRepositoryFactory.GetMock<ICharacterClassRepository>().Expect(item => item.Retrieve(_data.ID)).Returns(new List<ICharacterClassData> { characterClassData, characterClassData });
            classData.ModifierEnergy = 100;
            characterClassData.Ranks = 1;
            characterClassData.ClassID = classData.ID;
            characterClassData.CharacterID = _character.ID;

            _data.BaseEnergy = 123;
            Assert.AreEqual(323, _character.TotalEnergy);
        }

        #endregion

        #region TotalForce

        [TestMethod]
        public void TotalForce_Success_NoClassesOrRace()
        {
            _data.BaseForce = 123;
            Assert.AreEqual(123, _character.TotalForce);
        }

        [TestMethod]
        public void TotalForce_Success_NoClasses()
        {
            IRaceData race = new MockRace();
            MockRepositoryFactory.GetMock<IRaceRepository>().Expect(item => item.Retrieve(new Identity(123))).Returns(race);
            race.ModifierForce = 100;
            _data.RaceID = new Identity(123);

            _data.BaseForce = 123;
            Assert.AreEqual(223, _character.TotalForce);
        }

        [TestMethod]
        public void TotalForce_Success_1ClassNoRace()
        {
            IClassData classData = new MockClass();
            ICharacterClassData characterClassData = new MockCharacterClass();
            MockRepositoryFactory.GetMock<IClassRepository>().Expect(item => item.Retrieve(classData.ID)).Returns(classData);
            MockRepositoryFactory.GetMock<ICharacterClassRepository>().Expect(item => item.Retrieve(_data.ID)).Returns(new List<ICharacterClassData> { characterClassData });
            classData.ModifierForce = 100;
            characterClassData.Ranks = 1;
            characterClassData.ClassID = classData.ID;
            characterClassData.CharacterID = _character.ID;

            _data.BaseForce = 123;
            Assert.AreEqual(223, _character.TotalForce);
        }

        [TestMethod]
        public void TotalForce_Success_2ClassNoRace()
        {
            IClassData classData = new MockClass();
            ICharacterClassData characterClassData = new MockCharacterClass();
            MockRepositoryFactory.GetMock<IClassRepository>().Expect(item => item.Retrieve(classData.ID)).Returns(classData);
            MockRepositoryFactory.GetMock<ICharacterClassRepository>().Expect(item => item.Retrieve(_data.ID)).Returns(new List<ICharacterClassData> { characterClassData, characterClassData });
            classData.ModifierForce = 100;
            characterClassData.Ranks = 1;
            characterClassData.ClassID = classData.ID;
            characterClassData.CharacterID = _character.ID;

            _data.BaseForce = 123;
            Assert.AreEqual(323, _character.TotalForce);
        }

        #endregion

        #region TotalInsight

        [TestMethod]
        public void TotalInsight_Success_NoClassesOrRace()
        {
            _data.BaseInsight = 123;
            Assert.AreEqual(123, _character.TotalInsight);
        }

        [TestMethod]
        public void TotalInsight_Success_NoClasses()
        {
            IRaceData race = new MockRace();
            MockRepositoryFactory.GetMock<IRaceRepository>().Expect(item => item.Retrieve(new Identity(123))).Returns(race);
            race.ModifierInsight = 100;
            _data.RaceID = new Identity(123);

            _data.BaseInsight = 123;
            Assert.AreEqual(223, _character.TotalInsight);
        }

        [TestMethod]
        public void TotalInsight_Success_1ClassNoRace()
        {
            IClassData classData = new MockClass();
            ICharacterClassData characterClassData = new MockCharacterClass();
            MockRepositoryFactory.GetMock<IClassRepository>().Expect(item => item.Retrieve(classData.ID)).Returns(classData);
            MockRepositoryFactory.GetMock<ICharacterClassRepository>().Expect(item => item.Retrieve(_data.ID)).Returns(new List<ICharacterClassData> { characterClassData });
            classData.ModifierInsight = 100;
            characterClassData.Ranks = 1;
            characterClassData.ClassID = classData.ID;
            characterClassData.CharacterID = _character.ID;

            _data.BaseInsight = 123;
            Assert.AreEqual(223, _character.TotalInsight);
        }

        [TestMethod]
        public void TotalInsight_Success_2ClassNoRace()
        {
            IClassData classData = new MockClass();
            ICharacterClassData characterClassData = new MockCharacterClass();
            MockRepositoryFactory.GetMock<IClassRepository>().Expect(item => item.Retrieve(classData.ID)).Returns(classData);
            MockRepositoryFactory.GetMock<ICharacterClassRepository>().Expect(item => item.Retrieve(_data.ID)).Returns(new List<ICharacterClassData> { characterClassData, characterClassData });
            classData.ModifierInsight = 100;
            characterClassData.Ranks = 1;
            characterClassData.ClassID = classData.ID;
            characterClassData.CharacterID = _character.ID;

            _data.BaseInsight = 123;
            Assert.AreEqual(323, _character.TotalInsight);
        }

        #endregion

        #region TotalIntellect

        [TestMethod]
        public void TotalIntellect_Success_NoClassesOrRace()
        {
            _data.BaseIntellect = 123;
            Assert.AreEqual(123, _character.TotalIntellect);
        }

        [TestMethod]
        public void TotalIntellect_Success_NoClasses()
        {
            IRaceData race = new MockRace();
            MockRepositoryFactory.GetMock<IRaceRepository>().Expect(item => item.Retrieve(new Identity(123))).Returns(race);
            race.ModifierIntellect = 100;
            _data.RaceID = new Identity(123);

            _data.BaseIntellect = 123;
            Assert.AreEqual(223, _character.TotalIntellect);
        }

        [TestMethod]
        public void TotalIntellect_Success_1ClassNoRace()
        {
            IClassData classData = new MockClass();
            ICharacterClassData characterClassData = new MockCharacterClass();
            MockRepositoryFactory.GetMock<IClassRepository>().Expect(item => item.Retrieve(classData.ID)).Returns(classData);
            MockRepositoryFactory.GetMock<ICharacterClassRepository>().Expect(item => item.Retrieve(_data.ID)).Returns(new List<ICharacterClassData> { characterClassData });
            classData.ModifierIntellect = 100;
            characterClassData.Ranks = 1;
            characterClassData.ClassID = classData.ID;
            characterClassData.CharacterID = _character.ID;

            _data.BaseIntellect = 123;
            Assert.AreEqual(223, _character.TotalIntellect);
        }

        [TestMethod]
        public void TotalIntellect_Success_2ClassNoRace()
        {
            IClassData classData = new MockClass();
            ICharacterClassData characterClassData = new MockCharacterClass();
            MockRepositoryFactory.GetMock<IClassRepository>().Expect(item => item.Retrieve(classData.ID)).Returns(classData);
            MockRepositoryFactory.GetMock<ICharacterClassRepository>().Expect(item => item.Retrieve(_data.ID)).Returns(new List<ICharacterClassData> { characterClassData, characterClassData });
            classData.ModifierIntellect = 100;
            characterClassData.Ranks = 1;
            characterClassData.ClassID = classData.ID;
            characterClassData.CharacterID = _character.ID;

            _data.BaseIntellect = 123;
            Assert.AreEqual(323, _character.TotalIntellect);
        }

        #endregion

        #region TotalStrength

        [TestMethod]
        public void TotalStrength_Success_NoClassesOrRace()
        {
            _data.BaseStrength = 123;
            Assert.AreEqual(123, _character.TotalStrength);
        }

        [TestMethod]
        public void TotalStrength_Success_NoClasses()
        {
            IRaceData race = new MockRace();
            MockRepositoryFactory.GetMock<IRaceRepository>().Expect(item => item.Retrieve(new Identity(123))).Returns(race);
            race.ModifierStrength = 100;
            _data.RaceID = new Identity(123);

            _data.BaseStrength = 123;
            Assert.AreEqual(223, _character.TotalStrength);
        }

        [TestMethod]
        public void TotalStrength_Success_1ClassNoRace()
        {
            IClassData classData = new MockClass();
            ICharacterClassData characterClassData = new MockCharacterClass();
            MockRepositoryFactory.GetMock<IClassRepository>().Expect(item => item.Retrieve(classData.ID)).Returns(classData);
            MockRepositoryFactory.GetMock<ICharacterClassRepository>().Expect(item => item.Retrieve(_data.ID)).Returns(new List<ICharacterClassData> { characterClassData });
            classData.ModifierStrength = 100;
            characterClassData.Ranks = 1;
            characterClassData.ClassID = classData.ID;
            characterClassData.CharacterID = _character.ID;

            _data.BaseStrength = 123;
            Assert.AreEqual(223, _character.TotalStrength);
        }

        [TestMethod]
        public void TotalStrength_Success_2ClassNoRace()
        {
            IClassData classData = new MockClass();
            ICharacterClassData characterClassData = new MockCharacterClass();
            MockRepositoryFactory.GetMock<IClassRepository>().Expect(item => item.Retrieve(classData.ID)).Returns(classData);
            MockRepositoryFactory.GetMock<ICharacterClassRepository>().Expect(item => item.Retrieve(_data.ID)).Returns(new List<ICharacterClassData> { characterClassData, characterClassData });
            classData.ModifierStrength = 100;
            characterClassData.Ranks = 1;
            characterClassData.ClassID = classData.ID;
            characterClassData.CharacterID = _character.ID;

            _data.BaseStrength = 123;
            Assert.AreEqual(323, _character.TotalStrength);
        }

        #endregion

        #region TotalWill

        [TestMethod]
        public void TotalWill_Success_NoClassesOrRace()
        {
            _data.BaseWill = 123;
            Assert.AreEqual(123, _character.TotalWill);
        }

        [TestMethod]
        public void TotalWill_Success_NoClasses()
        {
            IRaceData race = new MockRace();
            MockRepositoryFactory.GetMock<IRaceRepository>().Expect(item => item.Retrieve(new Identity(123))).Returns(race);
            race.ModifierWill = 100;
            _data.RaceID = new Identity(123);

            _data.BaseWill = 123;
            Assert.AreEqual(223, _character.TotalWill);
        }

        [TestMethod]
        public void TotalWill_Success_1ClassNoRace()
        {
            IClassData classData = new MockClass();
            ICharacterClassData characterClassData = new MockCharacterClass();
            MockRepositoryFactory.GetMock<IClassRepository>().Expect(item => item.Retrieve(classData.ID)).Returns(classData);
            MockRepositoryFactory.GetMock<ICharacterClassRepository>().Expect(item => item.Retrieve(_data.ID)).Returns(new List<ICharacterClassData> { characterClassData });
            classData.ModifierWill = 100;
            characterClassData.Ranks = 1;
            characterClassData.ClassID = classData.ID;
            characterClassData.CharacterID = _character.ID;

            _data.BaseWill = 123;
            Assert.AreEqual(223, _character.TotalWill);
        }

        [TestMethod]
        public void TotalWill_Success_2ClassNoRace()
        {
            IClassData classData = new MockClass();
            ICharacterClassData characterClassData = new MockCharacterClass();
            MockRepositoryFactory.GetMock<IClassRepository>().Expect(item => item.Retrieve(classData.ID)).Returns(classData);
            MockRepositoryFactory.GetMock<ICharacterClassRepository>().Expect(item => item.Retrieve(_data.ID)).Returns(new List<ICharacterClassData> { characterClassData, characterClassData });
            classData.ModifierWill = 100;
            characterClassData.Ranks = 1;
            characterClassData.ClassID = classData.ID;
            characterClassData.CharacterID = _character.ID;

            _data.BaseWill = 123;
            Assert.AreEqual(323, _character.TotalWill);
        }

        #endregion
    }
}